package moe.oil.dto.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import moe.oil.enumeration.ExamType;
import moe.oil.validation.grop.OnInsert;
import moe.oil.validation.grop.OnUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

@Data
@Accessors(chain = true)
@Validated({OnInsert.class, OnUpdate.class})
public class UserTargetDTO {


    private Long userTargetId;

    @NotBlank(message = "目标类型不能为空")
    @NotNull
    private ExamType examType = ExamType.UNKNOWN;

    @NotNull
    @NotBlank(message = "位置不能为空")
    private String location;

    @NotNull
    @NotBlank(message = "目标专业不能为空")
    private String targetMajor;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd ")
    private LocalDate examYear;

}
